<?php

abstract class Core_Abstract
{
    /**
     * The view object
     *
     * @var Zend_View
     */
    public $view;

    /**
     * Sets the view
     *
     * @return void
     */
    public function __construct()
    {
        $this->setView();
    }

    /**
     * Returns the view object
     *
     * @return Zend_View
     */
    public function getView()
    {
        return $this->view;
    }

    /**
     * Sets the view
     *
     * @param  Zend_View $view
     * @return void
     */
    public function setView(Zend_View $view = null)
    {
        if ($view == null) {
            $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
            if (null === $viewRenderer->view) {
                $viewRenderer->initView();
            }
            $this->view = $viewRenderer->view;
        } else {
            $this->view = $view;
        }
    }
}